home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 21 / Cream of the Crop 21 (Terry Blount) (October 1996).iso / editor / auror300.zip / RULER.AML < prev    next >
Text File  |  1996-07-17  |  930b  |  41 lines

  1. //--------------------------------------------------------------------
  2. // RULER.AML
  3. // Insert a Ruler Line, (C) 1993-1996 by nuText Systems
  4. //
  5. // (see Ruler.dox for user help)
  6. //
  7. // This macro inserts a ruler line above the current line in an edit
  8. // window.
  9. //
  10. // Usage:
  11. //
  12. // Select this macro from the Macro List (on the Macro menu), or run it
  13. // from the macro picklist <shift f12>.
  14. //--------------------------------------------------------------------
  15.  
  16. include bootpath "define.aml"
  17.  
  18. // ruler text pattern
  19. constant rulertext = "····+····"
  20.  
  21. // extra columns beyond the right edge of the edit window
  22. constant extracolumns = 60
  23.  
  24. // test for edit windows
  25. if not wintype? "edit" then
  26.   msgbox "Edit windows only!"
  27.   return
  28. end
  29.  
  30. pushcursor
  31. undobegin
  32. insabove
  33. column = getcol
  34. up
  35. col 1
  36. for i = 1 to (getviewright + extracolumns) / 10 do
  37.   writetext rulertext + i mod 10
  38. end
  39. undoend
  40. popcursor
  41.